Method and device for synchronizing the global time of a plurality of ttcan buses and a corresponding bus system

ABSTRACT

A method, a device, and a bus system for synchronizing at least two TTCAN buses having at least one bus user, a global time being determined in each TTCAN bus, and the deviations in the global times of the TTCAN buses being determined from the global times, the TTCAN buses being connected via at least one user and the deviations in the individual global times being transmitted to at least one bus user, and the global times of the TTCAN buses connected via at least one user being adjusted to one another as a function of the deviations in the global times, so that the TTCAN buses are synchronized with respect to the global times.

BACKGROUND INFORMATION

[0001] The present invention relates to a method and a device forsynchronizing the global time in at least two TTCAN buses, as well as toa corresponding bus system.

[0002] In recent years, there has been a drastic increase in thenetworking of control units, sensors, and actuators by a communicationsystem, i.e. by a bus system, in the manufacturing of modem motorvehicles and machine construction, in particular in both the machinetool sector and automation. Synergistic effects may be achieved here dueto the distribution of functions among a plurality of control units.These are known as distributed systems. Communication between differentstations is increasingly being accomplished via at least one bus or atleast one bus system. Communication traffic on the bus system and theaccess and reception mechanisms, as well as error handling, areregulated by a protocol.

[0003] The CAN (controller area network) protocol is well established inthe automotive sector. This is an event-driven protocol, i.e. protocolactivities such as sending a message are initiated by events which havetheir origin outside the communications system. Unique access to thecommunication system or bus system, is triggered via priority-based bitarbitration. A prerequisite for this is that a priority is assigned toeach message. The CAN protocol is very flexible. It is, thus, readilypossible to add additional nodes and messages as long as there are stillfree priorities (message identifiers). The collection of all messages tobe sent in the network, together with their priorities and transmitternodes, plus possible reception nodes, are stored in a list known as thecommunication matrix.

[0004] An alternative approach to event-driven, spontaneouscommunication is the purely time-triggered approach. All communicationactivities on the bus are strictly periodic. Protocol activities such assending a message are triggered only by the advance of a time valid forthe entire bus system. Access to the medium is based on theapportionment of time periods during which a transmitter has anexclusive transmission right. The protocol is comparatively inflexible;new nodes may only be added if the corresponding time ranges havealready been freed up in advance. This circumstance requires that theorder of messages already be determined before starting operation. Thus,a timetable is drawn up which has to meet the requirements of themessage with respect to rate of repetition, redundancy, deadlines, etc.One speaks of a so-called bus schedule. The positioning of messageswithin the transmission periods must be coordinated with theapplications which produce the message content to minimize the latencybetween the application and the transmission time. If this matching doesnot take place, the advantage of the time-controlled transmission(minimal latent jitter when sending the message on the bus) isdestroyed. Thus, high demands are made on the planning tools. TTP/C issuch a bus system.

[0005] The requirements outlined above for a time-triggeredcommunication and the requirements for a certain measure of flexibilityare met by the method of time-triggered CAN known as TTCAN(time-triggered controller area network), which is described in GermanPatent Application No. 100 00 302 A1, German Patent Application No. 10000 303 A1, German Patent Application No. 100 00 304 A1 and German PatentApplication 100 00 305 A1, as well as in ISO Standard 11898-4 (currentlyin the form of a draft). TTCAN meets these requirements by establishingthe communication cycle (basic cycle) in so-called exclusive timewindows for periodic messages of certain communication users, and inso-called arbitrating time windows for spontaneous messages of aplurality of communication users. TTCAN is essentially based on atime-triggered, periodic communication, which is clocked by a user ornode, which gives the operating time and is known as the time master,with the help of a time reference message, or, for short, referencemessage. The period until the next reference message is known as thebasic cycle and is subdivided into a predefinable number of timewindows. In this context, a distinction is made between the local times,i.e. local timers of the individual users, i.e. nodes, and the time ofthe time master as the global time of its timer. Additional principlesand definitions based on TTCAN are given in the ISO Draft 11898-4 or thementioned related art and are thus assumed to be known and will not beexplicitly described again.

[0006] Thus, there are numerous real time bus systems for networkingcontrol units in automation, in motor vehicles or elsewhere, includingthe aforementioned CAN, TTP/C or Byteflight, as well as the TTCAN justmentioned. CAN, TTCAN and Byteflight are single-channel bus systems,which means that redundancy may be achieved by duplicating thecorresponding system. TTP/C is intrinsically a two-channel system, i.e.the redundancy is always built in. Many bus systems offer a time basesynchronized with the bus as a service. In the bus systems designed fromthe start as two-channel or multichannel solutions, the synchronizationper design is typically forced in that a node or user mustsimultaneously transmit on the two buses. This has advantages (e.g.synchronization is always ensured), but it also has a number ofdisadvantages, such as the fact that not every bus may be operated byitself, the time patterns on the two buses may only differ to a verylimited extent, and the modularity of the two or more bus systems isweakened due to the coupling which is provided by design.

[0007] As explained, it is obvious that the related art is incapable ofyielding optimum results in every respect. This situation is to beimproved in the following.

[0008] In the case of buses or bus systems designed as single-channelsystems, synchronization is performed explicitly if needed. In thefollowing, a TTCAN network is assumed to be a bus system, or it isassumed that there are a plurality of TTCAN buses or bus systems, andthat they are coupled, but this is only to be understood as restrictivewith regard to the object of the present invention to be explainedlater, inasmuch as the properties of the TTCAN are a prerequisite ornecessity for representing the object according to the presentinvention.

SUMMARY OF THE INVENTION

[0009] The present invention relates to a method, a device, and a bussystem for synchronizing at least two TTCAN buses having at least onebus user, a global time being determined in each TTCAN bus, and thedeviations in the global times of the TTCAN buses being determined fromthe global times, these buses being interconnected via at least oneuser, and the deviations in the individual global times beingtransmitted to at least one bus user, and the global times of the TTCANbuses connected via at least one user being adjusted to one another as afunction of the deviations in the global times, so that the buses aresynchronized with respect to the global times.

[0010] The global times of the TTCAN buses connected by at least oneuser are advantageously adjusted by adjusting the phase of the globaltime.

[0011] The global times of the TTCAN buses connected by at least oneuser are expediently adjusted by adjusting the frequency of the globaltime.

[0012] In an advantageous embodiment, the phase of the global time isadjusted as a function of the value of at least one predefined bit.

[0013] It is also advantageous that the at least one predefined bitcorresponds to the discontinuity bit of the TTCAN.

[0014] A smallest time unit (NTU) in the at least two TTCAN buses to besynchronized is advantageously determined for adjusting the frequency tothe global time, and the ratio of these smallest time units isdetermined and the resulting real ratio is compared to a predefinedratio, at least one smallest time unit being adjusted so that thepredefined ratio is achieved.

[0015] In addition, it is advantageous that the predefined ratiocorresponds to an integer, in particular a multiple or submultiple ofthe number two.

[0016] Further advantages and advantageous embodiments are derived fromthe description, as well as from the features of the claims.

BRIEF DESCRIPTION OF THE DRAWING

[0017] The present invention is explained in greater detail below on thebasis of the figures illustrated in the drawing, which show:

[0018]FIG. 1 the coupling of two TTCAN bus systems by a user whichfunctions as a gateway user;

[0019]FIG. 2 the coupling of three TTCAN bus systems by coupled pairs;

[0020]FIG. 3 the coupling of four TTCAN bus systems by various users toillustrate scalable tolerance;

[0021]FIG. 4 a flow chart of frequency adjustment between two TTCANbuses or TTCAN bus systems; and

[0022]FIG. 5 a flow chart to illustrate the phase adjustment of twoTTCAN buses or TTCAN bus systems.

DESCRIPTION OF THE EXEMPLARY EMBODIMENTS

[0023] The present invention describes general possibilities for how afault-tolerant bus system or network may be created from a combinationof several TTCAN buses. This is particularly advantageous in conjunctionwith the mechanisms with regard to synchronization of the global time ofa plurality of TTCAN buses and/or synchronization of the cycle time of aplurality of TTCAN buses, so that mutual synchronization of all thesebuses in the entire bus system or network may be accomplished.

[0024]FIG. 1 shows a bus system or network made up of a plurality ofTTCAN buses or TTCAN bus systems, in this case two. A first bus isrepresented by 103B1, and a second bus is represented by 103B2. Twousers 101 and 102 are connected to the first bus 103B1. A user 105 isconnected to second bus 103B2. User 100 is connected to both buses 103B1and 103B2 and functions as a connection user or gateway computer, i.e.gateway user, or also a gateway controller which has access to the twobuses. A coupled pair of TTCAN buses (103B1 and 103B2 here) is thusdefined as a combination of two TTCAN buses, such that there is at leastone gateway user having access to both buses. The connection of theindividual users to the particular bus is accomplished via acorresponding interface element, e.g. interface element 110B1 in thecase of user 101. Likewise, user 100 is connected as a gateway user tobus 103B1 via an interface element 104B1, and to bus 103B2 via aninterface element 104B2. As an alternative, one interface element havingtwo terminals may also be provided for connection to bus 103B1 and tobus 103B2, in contrast with two interface elements 104B1 and 104B2.

[0025] Timers 111 and 106 having an internal clock source or time source107 and 112, in particular a quartz crystal or an oscillator, especiallya VCO (voltage controlled oscillator), are also shown in users 100 and101. In addition, time detection modules, in particular counters 108 and113, are also contained in timers 106 and 111, respectively.

[0026] Control functions in the particular user, in particular forinput/output of data to the bus system, for transfer of time informationfrom the timer, and for synchronization of the buses and bus users, aswell as other methods and method steps, etc., in particular thoseaccording to the present invention, may be performed by modules 109and/or 114 as processing modules, in particular a microcomputer ormicroprocessor or controller. Parts of this functionality or the entirefunctionality may also be provided directly in the particular interfacemodule.

[0027] In this context, one user may also be preselected as a timereference generator as defined by TTCAN, in particular per bus system.This user, the time reference generator in the form of a time master,therefore specifies the basic cycle as described in the related art. Inthe same way, it is possible for the gateway user to function as a timereference generator, i.e. as a time master for the two bus systems. Thetime generator of the corresponding reference user, i.e. the time masterof the particular TTCAN system by which the local time of this timemaster is determined, is thus considered to be the reference timegenerator, i.e. it specifies the reference time for the correspondingbus system, i.e. 103B1 and/or 103B2. In other words, the local timegenerator, e.g. 106 and/or 111 of the specified reference user as thetime master, is thus considered a global time generator of thecorresponding bus or bus system 103B1 and/or 103B2 and specifies theglobal time of the corresponding bus.

[0028] Therefore, FIG. 1 shows a coupled pair of TTCAN buses having agateway user or gateway node. For more precise representation of thiscoupling according to the present invention, the following descriptionaccording to the present invention is used:

[0029] At least two TTCAN buses B1, B2 are coupled when there is aseries Pi=(BXi, BYi), where i=1 to n, and there are n elements N havingthe following properties:

[0030] BXi, BYi are TTCAN buses for all i,

[0031] For an i, BXi and BYi form a coupled pair of TTCAN buses,

[0032] BX(i+1) is BYi (for i=1 to n−1),

[0033] BX1 is bus B1 and BYn is bus B2.

[0034] In other words, two TTCAN buses B1 and B2 are coupled when theyare connected by some path of coupled pairs that is as complex. A systemof at least two TTCAN buses is referred to here as a fault-tolerantTTCAN bus system, if two of the buses are coupled (in the sensedescribed above). Therefore, all system architectures using afault-tolerant TTCAN bus system or network are detectable.

[0035] Additional examples are shown in FIGS. 2 and 3. FIG. 2 showsthree TTCAN buses 203B1, 203B2, and 203B3 as well as bus users 200, 201,204, and 205. Buses 203B1 and 203B2 are linked together by user 200, andbuses 203B2 and 203B3 are linked together by user 201 in the samemanner. Thus, in the sense according to the present invention, thecoupling of bus systems 203B1 and 203B2 and 203B2 and 203B3 as coupledpairs by users 200 and 201 also allows bus systems 203B1 and 203B3 to beconnected in a fault-tolerant manner according to the definition givenabove, in particular with respect to synchronization. In contrast toconventionally redundant systems, i.e. two buses in the entire bussystem, where each node or user is connected in a redundant manner toevery other bus, i.e. each user has a connection to each bus, the systemarchitectures proposed here allow a scalable fault tolerance and amixture of fault-tolerant and non-fault-tolerant systems due to the useof coupled pairs.

[0036] This is explained once more, using FIG. 3 as an example. Fourbuses 303B1, 303B2, 303B3, and 303B4 are shown in it. In addition, bususers 301, 302, 300, 304, and 305 are also shown. Buses 303B1 and 303B2are linked together by user 300, and buses 303B3 and 303B4 are linkedtogether by user 301. At the same time, three buses 303B1, 303B2, and303B3 are interconnected by a user 302 so that, on one hand, a mixtureof fault-tolerant and non-fault-tolerant systems is made possible, and,on the other hand, the desired fault tolerance in the system isscalable, i.e. it may be represented in various degrees of redundancy(single, double, multiple redundancy). Therefore, it is possible tointroduce higher degrees of redundancy into a system, without couplingsystems that should remain uncoupled. Consequently, a reduction incommon-mode faults, i.e. common-mode faults of the bus system or the bussystems, is likewise possible.

[0037] In combination with the synchronization mechanisms in TTCAN, itis thus possible to create a uniform synchronized communication systemthat permits all conceivable degrees of fault tolerance in the simplestmanner. Synchronization is described in greater detail below withrespect to the global time as well as the cycle times of individualusers or bus systems.

[0038] A general method of how two or more TTCAN buses, in particularlevel 2 buses (see ISO Draft), are able to synchronize their globaltimes with one another will be described first. This method may be usedby dedicated hardware, by the applications running on the correspondinghost, or by a special software layer.

[0039] The method of synchronization, including possible variations inthe sequence, is described below. A pair of buses is referred to here asbeing directly synchronizable, if there is at least one gateway computerhaving access to both buses, as described above. It is also a generalprerequisite that, between two buses to be synchronized, there is achain of gateways connecting the two buses via directly synchronizablepairs, i.e. the coupled pairs mentioned above. The synchronization layer(hardware or software) performing the synchronization is referred tobelow as synchronization layer SL. In doing so, the SL need notnecessarily be present on each node, as also indicated by the followingdescription.

[0040] In one embodiment, the gateway user or gateway computer is thetime master in at least one of the two buses to be synchronized, inorder to adjust the time in the bus in which it is time master.Optionally, as an additional embodiment, a message may be transmittedfrom the gateway user to the time master to perform the correspondingtime adjustment for the synchronization. Then, it is not necessary forthe gateway user to also be time master of at least one of the bussystems to be synchronized.

[0041] On each TTCAN bus, the initialization procedure specified forthis bus by ISO 11898-4 and the related art for the TTCAN is run throughfor initialization. As a result, one obtains two or more TTCAN buses,which operate independently of each other and have different globaltimes and different current time masters. In an optional variant, thesystem design allows one to ensure that the same node or user becomesthe time master on both buses or on a plurality of buses.

[0042] Then, on the basis of FIGS. 4 and 5, frequency adjustment andphase adjustment are described, whereby the frequency and the phase ofthe buses are adjustable independently of one another; in anadvantageous embodiment, first the frequency is adjusted because, aslong as the frequency is incorrect, i.e. deviates, the phase will bechanged continuously.

[0043] A) Frequency Adjustment Between Two Buses

[0044] In the TTCAN, the rate of the global time, i.e. the length oftime unit NTU, is determined by the timer frequency of the time master,i.e. in particular the oscillator frequency or quartz crystal frequencyand its TUR (time unit ratio) value. In this context, NTU (network timeunit) refers to the time units of the global time of the particular bus,and TUR refers to the ratio between the length of an NTU and the lengthof a specific basic time unit, e.g. the local timer period, i.e. inparticular the local oscillator period as described in ISO Draft11898-4. Synchronization layer SL must ensure that the NTU's on thedifferent buses have the intended ratios to one another. The SL may berepresented in hardware or software by processing units 109 and/or 114,etc., but, as mentioned already, the SL need not necessarily be inherentin all users.

[0045] In principle, different procedures are conceivable. One bus maybe coordinated with the other by selecting the frequency of one bus,i.e. the rate of the global time of the one bus as a setpoint anddetermining the difference in rate with respect to it, i.e. frequency,of the of the bus; the at least one additional bus being coordinatedwith the other or the at least two buses approaching each other withrespect to the rate of the global time, i.e. in particular the frequencyof the timer of the particular time masters. In addition, the adjustmentmay be performed in one step or gradually. The particular strategydepends on the SL, i.e. the synchronization layer, and the requirementsof the particular applications. All methods have the following system incommon:

[0046] The SL determines the correction to be performed for a bus andtransmits it to the current time master. The correction may be, forexample, the ratio of the current TUR value and the new TUR value to beset. It is particularly advantageous if the SL determines the correctionon the time master, so that the correction value may be the new TURvalue directly, for example.

[0047] The SL determines the new TUR value in the time master and usesit, starting with the following cycle.

[0048] All the other nodes of this bus then follow the time master overthe TTCAN synchronization.

[0049] To this end, the global time of the first bus, e.g. B1, isdetermined, e.g. 103B1, in block 400 of FIG. 4. This is determined at atime T1 in block 401, i.e. captured, so that a first capture value ofthe global time of bus B1 is obtained in block 401. At time T1, a valueof the global time of bus B2 determined in block 404, e.g. 103B2, isdetected, i.e. captured, in block 405. At subsequent time T2, the firstcapture value is advanced from block 401 and block 405. to block 402 andblock 406, respectively, and a new, second capture value is detectedwith respect to the global time of the particular bus in block 401 or405. From these two capture values in block 401 and block 402 and block405 and block 406, the rate of the global time or the clock rate ofbusses B1 and B2, respectively, is determined by forming the differencein block 403 and block 407, respectively. Then, by forming thedifference in block 409, a correction value is obtained from thesevalues for the rate of the global time of the particular bus, thiscorrection value representing the difference in the rate of the globaltimes of the buses in question, i.e. the difference in the particularclock rate, i.e. the timer rate. As mentioned above, this may also occuror be carried out, e.g. using the specific TUR value. The rest of themethod of the present invention then proceeds with the aid of the value,which was determined in block 409 and relates to the frequencyadjustment in block 401.

[0050] The frequency adjustment is to be illustrated again, using anexample. There are two buses, B1 and B2. The synchronization strategy isthat B2 must adjust the length of the NTU to the length valid on B1. Inthe simplest case, it is assumed that both are nominally the samelength. The application (SL) of the current time master of B2 is assumedto have direct access to bus B1, and the same timer, i.e. the same clocksource or time source, i.e. the same oscillator or quartz crystal, is tobe used for B1 and B2. Then, the NTU's of the two buses B1 and B2 areexactly the same length when the TUR value of this node or user withrespect to bus B1 is equal to the TUR value of this node and/or userwith respect to bus B2. Therefore, the SL must use the TUR value withrespect to B1 as the TUR value with respect to B2.

[0051] In principle, the situation may be handled in the same way, ifthe NTU's of the two buses have any desired ratio to one another. Thisis then easily implementable in hardware in an advantageous manner, ifthe ratio or its reciprocal is an integer and, in a particularlyadvantageous embodiment, a power of two.

[0052] If the same timer, i.e. the same time source, is not used forboth buses, then there is the possibility of measuring the difference inthe global times of the two buses twice or more often, i.e. periodicallyin succession, and calculating a correction factor from the comparisonbetween the observed change in the difference and the nominal change inthe difference. This possibility also exists if the current time masterdoes not have access to the two buses itself. As an alternative, the SLmay measure the length of a basic cycle on a bus in units of the otherbus and then determine the correction value from it.

[0053] B) Phase Adjustment

[0054] For the phase adjustment, the SL measures the phase differencebetween two global times on two buses and determines the jump, i.e.correction value, to be set for each of the two buses. This may beaccomplished in an advantageous manner with the aid of the stopwatchregister of the TTCAN.

[0055] The SL then transmits the jump or correction value to be set tothe two current time masters of the two buses. A time master that mustset a jump sets a predefined bit, specifically the discontinuity bit inthe case of TTCAN, in the next reference message and shifts its globaltime by the corresponding amount. In this manner, the time referencemessage, i.e. the reference message, of the corresponding time master isthen sent at the adjusted time. After this (these) reference message(s)are successfully transmitted on at least one of the two buses, the atleast two buses are synchronized with one another, if necessary.

[0056]FIG. 5 shows this phase adjustment. The global times of two busesare ascertained in blocks 500 and 504 and acquired, i.e. captured, inblock 501 and block 505. In this context, capturing preferably occurs atthe same time T1. The two computer values are now sent directly to asubtractor in block 509 where the phase difference, i.e. the differencein the clock phase, the clock source phase, or the time source phase maybe determined based on the simple capture values of the two buses. Therest of the described method according to the present invention is thenexecuted in block 510.

[0057] In the case of more than two buses, it is particularlyadvantageous that, when two buses are synchronized in pairs in such amanner, the jump, i.e. the correction only takes place on one of the twobuses, i.e. one of the two buses assumes a master role for the globaltime. That is, the global time remains unchanged on the first bus, andthe global time on the second bus jumps, i.e. is changed. In this case,more than two buses may easily be synchronized successively, usingpaired synchronization, without this synchronization of a pair having aparticularly complex influence on that of another pair.

[0058] This is to be illustrated on the basis of an example. There arefive buses B1, B2, B3, B4, B5 in the system. The synchronizable, coupledpairs are (B1, B2), (B1, B3), (B2, B4), (B3, B5). If B1 is the masterfor B2 and B3, B2 is the master for B4, and B3 is the master for B5,then the paired synchronization (B2 and B3 are first synchronized to B1,then B4 is synchronized to B2, and B5 is synchronized to B3) results insystem-wide synchronization within two cycles.

[0059] In the same system, synchronization could also be performedwithout the master principle. Then, however, the SL must ensure that thebuses synchronized once also remain synchronized, i.e. that a jump or achange on one bus also takes place on all buses synchronized with it.

[0060] In addition, it is advantageous (but not necessary) for the timemaster of a bus to be synchronized to also have direct access to theglobal time of the corresponding partner bus. In this case, the SL mayonly be set up for the potential time masters of one bus, i.e. the SLmessage regarding the level of the jump to be set is eliminated orbecomes very simple.

[0061] It is not necessary for the NTU's, i.e. the time units of theglobal time on the buses to be synchronized, to be the same. However, itis particularly simple and useful for the (nominal) NTU's between twocoupled buses to only differ by an integral factor (powers of two in aparticularly advantageous manner).

[0062] C) Phase Adjustment By Frequency Shift

[0063] As an alternative to the mechanism described above with respectto the phase adjustment in point B), there is also the possibility ofachieving a phase adjustment through a long-term change in rate (seepoint A in this regard). The procedure is exactly the same in principalas that described in point A) for the frequency adjustment between twobuses. In this case, however, the object is not to exactly adjust theNTU of the bus to the target value there, but instead to lengthen orshorten this NTU slightly, so that the clock or timer to be adjusted isincremented somewhat more slowly or rapidly, and thus, a phaseadjustment is achieved over a longer period of time.

[0064] D) Preserving the Synchronized State

[0065] After a phase adjustment as in B) or C), there are variousoptions for retaining the synchronized state. On one hand, by repeatingthe phase adaptation as soon as the monitored phase exceeds a particularvalue, and on the other hand, by adapting the frequency as described inpoint A). In addition, there is a combination of these twopossibilities. Since, in the method described in point A, the frequencyadjustment typically takes place one cycle later than a correspondingchange in frequency in the master bus, an accumulation of a differencemay even result when the frequencies of the buses involved are verypersuasively matched. In this case, a minor phase adjustment orcompensation must occasionally be accomplished by a targeted, inparticular predefined frequency which does not exactly match.

[0066] Use of the corresponding TTCAN interface may be demonstrated by adebugging instrument. The performance on the bus may also be analyzed bybus monitoring.

[0067] A general method of synchronization is now described below,showing how two or more TTCAN buses may mutually synchronize their cycletimes. Here again, this method may be implemented by dedicated hardware,by the application running on the corresponding hosts, or by a specialsoftware layer.

[0068] The sequence of the method, including possible variants, isdescribed below; the same prerequisites and definitions apply as was thecase in synchronization of the global time, i.e. directsynchronizability when there is at least one gateway computer havingaccess to both buses, and there is a chain of gateways between two busesto be synchronized, connecting the two buses via directlysynchronizable, coupled pairs. Here again, the synchronization isperformed by a synchronization layer in hardware or software, whichperforms the synchronization and is referred to below as synchronizationlayer SLZ with respect to the cycle times. Here again, the SLZ need notnecessarily be present at each node. First, the frequency adjustmentbetween two buses will again be discussed here in point AZ).

[0069] AZ) Frequency Adjustment Between Two Buses

[0070] A frequency adjustment is only possible in TTCAN level 2 viaprotocol mechanisms. However, it is sufficient if the time master isoperated in level 2 operation. This is not necessary for other nodes.There, the adjustment proceeds there like the corresponding adjustmentfor the global time, as described above, and thus cannot be madeindependently of this adjustment if the global time is also synchronizedin the same network.

[0071] In TTCAN level 2, the rate of the cycle time, i.e. the length ofunit of time NTUZ is determined by the frequency of the timer, inparticular the oscillator of the time master and its TUR value, asalready described above for the global time. The SLZ must ensure thatthe NTUZ's have the specified ratios to one another on the differentbuses. In this context, the NTUZ's may be the same as or different fromthe NTU mentioned above.

[0072] In principle, different procedures are conceivable. Either onebus may be adjusted to the others or two or more mutually approach eachother. In addition, the adjustment may in turn take place in one step orgradually. The particular strategy depends on the SLZ and therequirements of the application. In particular, the synchronization ofthe global time and synchronization of the cycle time may be performedby the same software layer, i.e. the same synchronization layer SL,which may be expressed as follows in an advantageous embodiment:

SL=SLZ.

[0073] All the methods regarding the frequency adjustment have thefollowing scheme in common within the scope of the cycle time:

[0074] The SLZ determines the correction to be performed for a bus andnotifies the current time master of it. The correction may be, forexample, the ratio of the instantaneous TUR value and the new TUR valueto be set.

[0075] It is, in turn, particularly advantageous if the SLZ determinesthe correction on the time master. Then, the correction value may be,for example, the new TUR value.

[0076] The SLZ determines the new TUR value in the time master and usesit as of the following cycle.

[0077] All the other nodes of this bus follow the time master via TTCANsynchronization.

[0078] This method may be explained again on the basis of FIG. 4, wherethe sequence is essentially the same, except that the cycle time is usedinstead of the global time. Therefore, reference is made here to thepreceding discussions of FIG. 4, and details will not be explicitlydescribed again.

[0079] Another Example:

[0080] There are two buses, B1 and B2. The synchronization strategy isthat B2 must adjust the length of the NTUZ to the length valid on B1. Inthe simplest case, both are nominally the same length. The application(SLZ) of the current time master of B2 is assumed to have direct accessto bus B1, and the same oscillator is to be used for B1 and B2. Then,the NTUZ's of the two buses B1 and B2 are exactly the same length whenthe TUR value of this node with respect to B1 is equal to the TUR valueof this node with respect to B2. Therefore, the SLZ must use the TURvalue with respect to B1 as the TUR value with respect to B2.

[0081] In principle, the situation may be handled in the same way, ifthe NTUZ's of the two buses have any desired ratio to one another. Inhardware, it is again advantageous for the ratio or the reciprocal valueto be an integer, in particular one that is squared. If the same timer,in particular oscillator, is not used for both buses, there is again theaforementioned possibility of measuring the difference in the globaltimes of the two buses at least twice and/or periodically in succession,and calculating a correction factor from the comparison between theobserved change in the difference and the nominal change in thedifference. This possibility is also given again, if the current timemaster does not have access to both buses. As an alternative, the SLZmay measure the length of a basic cycle from one bus in units of theother bus and determine the correction value from this.

[0082] BZ) Phase Adjustment

[0083] The SLZ again measures the phase difference between two times ontwo buses and determines the jump, i.e. change, to be set for each ofthe two buses. The SLZ transmits the particular jump to be set to thetwo current time masters of the two buses.

[0084] A time master having to set a jump sets, in turn, a predefinedbit, in this case, especially the Next_is_Gap bit of the TTCAN (see ISODraft), in the reference message. From the local SLZ, it receives thestarting time of the next basic cycle.

[0085] After this (these) reference message or messages is/are possiblysuccessfully sent on the two buses, the cycle time phases of the twobuses are synchronized.

[0086] This may again be represented by FIG. 5, as described above; thecycle time being used instead of the global time, and the Next_is_bitbeing used. This desired phase may be 0 here, i.e. the basic cyclebegins at the same time on both buses. However, this is by no meansnecessary. It is not necessary for the NTUZ's, i.e. the time units ofthe cycle time, to be the same on the buses to be synchronized. However,it is particularly simple and useful if the (nominal) NTUZ's between twocoupled buses differ only by an integral factor, in particular powers oftwo, in an advantageous manner.

[0087] It is also not necessary for the cycle lengths of the buses to besynchronized to be the same. However the method proposed here isparticularly beneficial when the (nominal) cycle lengths of the twobuses are in a rational ratio to one another which does not useexcessively large natural numbers, because then it is regularly possibleto speak of a fixed phase in an easily reproducible manner. Example: Two(nominal) cycles are running on one bus B1, while three are running onanother bus B2. Then, a theoretically fixed phase relation between B1and B2 is present every other cycle on B1 (every third cycle on B2).

[0088] In the case of more than two buses, it is particularlyadvantageous if, with such a paired synchronization of two buses, thejump only takes place on one of the two buses, i.e. one of the two busesassumes a master role for the phase of the cycle time. In other words,the sequence of basic cycles on the first bus remains unchanged, while agap is inserted between two basic cycles on the second bus, the gapbeing just large enough to adjust the desired phase. In this case, morethan two buses may easily be synchronized successively via the pairedsynchronization without the synchronization of a pair having aparticularly complex influence on that of another pair.

EXAMPLE

[0089] There are five buses in the system, B1 through B5. Synchronizablepairs include (B1, B2), (B1, B3), (B2, B4), (B3, B5). If B1 is themaster for B2 and B3, and B2 is the master for B4, and B3 is the masterfor B5, then the paired synchronization (B2 and B3 are firstsynchronized to B1, then B4 is synchronized to B2, and B5 issynchronized to B3) results in system-wide synchronization within twocycles.

[0090] In the same system, synchronization could also be performedwithout the master principle. Then, however, the SLZ must ensure thatonce buses are synchronized, they will remain synchronized, i.e. a jumpor a correction on one bus will also take place on all busessynchronized with it.

[0091] In addition, it is advantageous (but not necessary) for the timemaster of a bus to be synchronized to also have direct access to thecorresponding partner bus. In this case, the SLZ may only be set up forthe potential time masters of one bus, i.e. the SLZ message regardingthe level of the jump to be set is eliminated or becomes very simple.

[0092] CZ) Phase Adjustment By Frequency Shift

[0093] As a further alternative to the mechanism, this time the one insection BZ), it is also possible, here, to achieve a phase equalizationby longer-term modification of the rate, as in point AZ). The basicprocedure is exactly the same as that described in point AZ). However,the goal in this case is not to precisely adjust the NTUZ's of the busto be adjusted to the target value there, but to slightly lengthen orshorten these NTUZ's, so that the clock to be adjusted is incrementedslightly more slowly or more rapidly, and therefore, a phase adjustmentis achieved over a longer period of time.

[0094] DZ) Preserving the Synchronized State

[0095] After a phase adjustment as in BZ) or CZ), there are variouspossibilities for maintaining the synchronized state, as alreadydescribed in point D) of synchronization of the global time:

[0096] Repeating the phase adjustment as soon as the observed phaseexceeds a certain value.

[0097] Adjusting the frequency as in AZ) or A) or a combination of thetwo possibilities.

[0098] In the method described in AZ) or A), the frequency adjustment istypically performed one cycle later than a corresponding frequencychange in the master bus, so even when there is a very precise matchingof the frequencies of the buses involved, this may result in anaccumulation of a difference. In this case, a small phase adjustment orcompensation must occasionally be performed, using a frequency whichintentionally does not match exactly. As in synchronization of theglobal time, this use may be displayed by a debugging instrument, orperformance on the bus may be analyzed with the aid of bus monitoring.

What is claimed is:
 1. A method for synchronizing at least two TTCANbuses having at least one bus user, a global time being determined ineach TTCAN bus, and the deviations in the global times of the TTCANbuses being determined from the global times, these buses beingconnected via at least one user and the deviations in the individualglobal times being transmitted to at least one bus user, and the globaltimes of the TTCAN buses connected via at least one user being adjustedto one another as a function of the deviations in the global times, sothat the TTCAN buses are synchronized with respect to the global times.2. The method as recited in claim 1, wherein the cycle times of theTTCAN buses connected via at least one user are adjusted by adjustingthe phase of the global time.
 3. The method as recited in claim 1,wherein the global times of the TTCAN buses connected via at least oneuser are adjusted by adjusting the frequency of the global time.
 4. Themethod as recited in claim 2, wherein the phase of the global time isadjusted as a function of the value of at least one predefined bit. 5.The method as recited in claim 4, wherein the at least one predefinedbit corresponds to the discontinuity bit of the TTCAN.
 6. The method asrecited in claim 3, wherein, in each instance, a smallest time unit(NTU) in the at least two TTCAN buses to be synchronized is determinedfor adjusting the frequency of the global time, and the ratio of thesesmallest time units is determined, and the resulting real ratio iscompared to a predefined ratio, at least one smallest time unit beingadjusted so that the predefined ratio is attained.
 7. The method asrecited in claim 6, wherein the predefined ratio is an integercorresponding to, in particular, a multiple or a submultiple of thenumber two.
 8. A device for synchronizing at least two TTCAN buseshaving at least one bus user; first means being included which determinea global time in each TTCAN bus and determine, from the global times,the deviations in the global times of the TTCAN buses that are linkedtogether by at least one user and transmit the deviations in theindividual global times to at least one bus user; second means beingincluded which perform an adjustment of the global times of the TTCANbuses connected by at least one user, as a function of the deviations inthe global times, so that these buses are synchronized with respect tothe global times.
 8. The device as recited in claim 8, wherein the firstand second means are contained in a synchronization layer, which isincluded in at least one user.
 10. A bus system comprising at least twodata buses, the first data bus having a first number of users and thesecond data bus having a second number of users, wherein at least twoTTCAN buses are used as data buses, at least one user being included asa connection user, such that two of the at least two TTCAN buses aresimultaneously connected to the at least one connection user, and a userperforming a time-master function for each TTCAN bus being included; inthe case of a bus system having more than two TTCAN buses, these beingconnected in such a manner that, in each instance, at least two TTCANbuses have at least one common connection user, and synchronizationmeans being included in the bus system, which determine a global time ineach TTCAN bus and transmit the deviations in the individual globaltimes to the users having a time-master function, the users having atime-master function adjusting the specific, global time.